package Assignment;

import java.util.Scanner;

//需求：在主方法中通过键盘录入三个整数。定义一个方法，方法接收三个整数变量，在方法中从大到小依次打印三个变量。
public class Test3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入第一个整数：");
        int num1 = scanner.nextInt();
        System.out.println("请输入第二个整数：");
        int num2 = scanner.nextInt();
        System.out.println("请输入第三个整数：");
        int num3 = scanner.nextInt();

        Sort(num1,num2,num3);

    }

    public static int getMax(int num1, int num2, int num3) {
        int max = num1 > num2 ? num1 : num2;

        return max > num3 ? max : num3;
    }
    public static int getMin(int num1, int num2, int num3) {
        int min = num1 < num2 ? num1 : num2;

        return min < num3 ? min : num3;
    }


    public static void Sort(int num1, int num2, int num3){
        int max = getMax(num1,num2,num3);
        int min = getMin(num1,num2,num3);
        int medium = (num1+num2+num3)-max-min;

        System.out.println(max+" "+medium+" "+ min);

    }

}
